<template>
  <div class="app-container">
    <el-row :gutter="20">
      <!--部门数据-->
      <el-col :span="spanColLeft" :xs="24">
        <div class="head-container">
          <el-input
            v-model="deptName"
            id="deptName"
            placeholder="请输入部门名称"
            clearable
            size="small"
            prefix-icon="el-icon-search"
            style="margin-bottom: 20px"
          />
        </div>
        <div class="head-container">
          <el-tree
            :data="deptOptions"
            :props="defaultProps"
            :expand-on-click-node="false"
            :filter-node-method="filterNode"
            ref="tree"
            node-key="id"
            default-expand-all
            highlight-current
            @node-click="handleNodeClick"
          />
        </div>
      </el-col>
      <!--用户数据-->
      <el-col :span="spanColRight" :xs="24">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="数据库名" prop="appName">
            <el-input
              v-model="queryParams.appName"
              placeholder="请输入数据库名称"
              clearable
              @keyup.enter.native="handleQuery"
              id="appName"
            />
          </el-form-item>
          <!--      <el-form-item label="项目节点IP地址" prop="ipaddr">
                  <el-input
                    v-model="queryParams.ipaddr"
                    placeholder="请输入项目节点IP地址"
                    clearable
                    @keyup.enter.native="handleQuery"
                  />
                </el-form-item>
                <el-form-item label="项目节点端口" prop="appport">
                  <el-input
                    v-model="queryParams.appport"
                    placeholder="请输入项目节点端口"
                    clearable
                    @keyup.enter.native="handleQuery"
                  />
                </el-form-item>-->
          <el-form-item label="项目类型" prop="apptypeid">
            <el-select v-model="queryParams.apptypeid" placeholder="请选择项目类型" @change="handleQuery" id="apptypeid" clearable>
              <el-option
                v-for="apptype in appTypeOptions"
                :key="apptype.id"
                :label="apptype.apptypename"
                :value="apptype.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="用户名" prop="customer">
            <el-input
              v-model="queryParams.customer"
              placeholder="请输入用户名"
              clearable
              @keyup.enter.native="handleQuery"
              id="customer"
            />
          </el-form-item>
          <el-form-item label="项目名称" prop="appexplain">
            <el-input
              v-model="queryParams.appexplain"
              placeholder="请输入项目名称"
              clearable
              @keyup.enter.native="handleQuery"
              id="appexplain"
            />
          </el-form-item>
          <el-form-item label="初始化" prop="appstate">
            <el-select v-model="queryParams.appstate" placeholder="是否初始化" @change="handleQuery" id="appstate" clearable>
              <el-option
                v-for="dict in dict.type.sys_init_yes_no"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="是否关闭" prop="state">
            <el-select v-model="queryParams.state" placeholder="是否关闭" @change="handleQuery" id="state" clearable>
              <el-option
                v-for="dict in dict.type.sys_notice_status"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="所属省份" prop="region">
            <el-input
              v-model="queryParams.region"
              placeholder="请输入所属省份"
              clearable
              @keyup.enter.native="handleQuery"
              id="region"
            />
          </el-form-item>
          <el-form-item label="所属城市" prop="city">
            <el-input
              v-model="queryParams.city"
              placeholder="请输入所属城市"
              clearable
              @keyup.enter.native="handleQuery"
              id="city"
            />
          </el-form-item>
          <el-form-item label="经度" prop="longitude">
            <el-input
              v-model="queryParams.longitude"
              placeholder="请输入经度"
              clearable
              @keyup.enter.native="handleQuery"
              id="longitude"
            />
          </el-form-item>
          <el-form-item label="纬度" prop="latitude">
            <el-input
              v-model="queryParams.latitude"
              placeholder="请输入纬度"
              clearable
              @keyup.enter.native="handleQuery"
              id="latitude"
            />
          </el-form-item>
<!--          <el-form-item label="所属客户" prop="customer">
            <el-input
              v-model="queryParams.customer"
              placeholder="请输入所属客户"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>-->
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>

        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="primary"
              icon="el-icon-d-arrow-left"
              size="mini"
              @click="handleShowLeft"
            >隐藏/显示左侧选择树</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="primary"
              plain
              icon="el-icon-plus"
              size="mini"
              @click="handleAdd"
              v-hasPermi="['system:appmanager:add']"
            >新增</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-edit"
              size="mini"
              :disabled="single"
              @click="handleUpdate"
              v-hasPermi="['system:appmanager:edit']"
            >修改</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              plain
              icon="el-icon-delete"
              size="mini"
              :disabled="multiple"
              @click="handleDelete"
              v-hasPermi="['system:appmanager:remove']"
            >删除</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="warning"
              plain
              icon="el-icon-download"
              size="mini"
              @click="handleExport"
              v-hasPermi="['system:appmanager:export']"
            >导出</el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
        </el-row>

        <el-table v-loading="loading" :data="appmanagerList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="项目ID" width="60" align="center" key="appid" prop="appid" v-if="columns[0].visible" />
          <el-table-column label="数据库名称" align="center" key="appName" prop="appName" v-if="columns[1].visible" :show-overflow-tooltip="true" width="110"/>
          <el-table-column label="项目节点IP地址" align="center" key="ipaddr" prop="ipaddr" v-if="columns[2].visible" :show-overflow-tooltip="true" />
          <el-table-column label="项目节点端口" align="center" key="appport" prop="appport" v-if="columns[3].visible" :show-overflow-tooltip="true" />
          <el-table-column label="项目节点用户名" align="center" key="customer" prop="customer" v-if="columns[4].visible" />
          <el-table-column label="项目名称" align="center" key="appexplain" prop="appexplain" v-if="columns[5].visible" :show-overflow-tooltip="true" width="120"/>
          <el-table-column label="所属部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[6].visible" :show-overflow-tooltip="true" width="190"/>
          <el-table-column label="项目类型" align="center" key="apptypename" prop="appType.apptypename" v-if="columns[7].visible" :show-overflow-tooltip="true" />
          <el-table-column key="appstate" prop="appstate" label="是否初始化" width="85" v-if="columns[8].visible">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_init_yes_no" :value="scope.row.appstate"/>
            </template>
          </el-table-column>
          <el-table-column key="state" prop="state" label="是否关闭" width="75" v-if="columns[9].visible">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_notice_status" :value="scope.row.state"/>
            </template>
          </el-table-column>
          <el-table-column label="所属省份" align="center" key="region" prop="region" v-if="columns[10].visible" :show-overflow-tooltip="true"/>
          <el-table-column label="所属城市" align="center" key="city" prop="city" v-if="columns[11].visible" :show-overflow-tooltip="true"/>
          <el-table-column label="经度" width="75" align="center" key="longitude" prop="longitude" v-if="columns[12].visible" :show-overflow-tooltip="true"/>
          <el-table-column label="纬度" width="75" align="center" key="latitude" prop="latitude" v-if="columns[13].visible" :show-overflow-tooltip="true"/>
          <!--      <el-table-column label="项目简介" align="center" prop="appIntroduction" />
                <el-table-column label="所属客户" align="center" prop="customer" />
                <el-table-column label="运行状态,0已停止,1运行中" align="center" prop="runStatus" />
                <el-table-column label="3D模型地址" align="center" prop="modelIp" />
                <el-table-column label="2D模型地址" align="center" prop="model2dIp" />-->
          <el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                v-if="scope.row.appstate === '0'"
                size="small"
                type="warning"
                plain
                icon="el-icon-plus"
                @click="handleInit(scope.row)"
                v-hasPermi="['system:appmanager:add']"
              >初始化项目</el-button>
              <el-button
                v-if="scope.row.appstate === '1' && scope.row.state === '0' && currentProjectName !== scope.row.appexplain"
                size="small"
                type="success"
                plain
                icon="el-icon-view"
                @click="handleFixProject(total,scope.row)"
                v-hasPermi="['system:appmanager:query']"
              >进入项目</el-button>
              <el-button
                v-if="scope.row.appstate === '1' && scope.row.state === '0' && currentProjectName === scope.row.appexplain"
                size="small"
                type="warning"
                plain
                icon="el-icon-view"
                @click="handleFixProject(total,scope.row)"
                v-hasPermi="['system:appmanager:query']"
              >进入项目</el-button>
              <el-button
                v-if="scope.row.appstate === '1' && scope.row.state === '1'"
                size="small"
                type="danger"
                plain
                icon="el-icon-view"
                @click="restoredProject(scope.row)"
                v-hasPermi="['system:appmanager:edit']"
              >恢复项目</el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['system:appmanager:edit']"
              >修改</el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['system:appmanager:remove']"
              >删除</el-button>
            </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </el-col>
    </el-row>

    <!-- 添加或修改项目信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row>
          <el-col :span="24">
            <el-form-item label="项目名称" prop="appexplain">
              <el-input v-model="form.appexplain" placeholder="请输入项目名称" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="数据库名" prop="appName">
              <el-input v-model="form.appName" placeholder="请输入数据库名" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="用户名" prop="customer">
              <el-input v-model="form.customer" placeholder="请输入项目用户名" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="IP地址" prop="ipaddr">
              <el-input v-model="form.ipaddr" placeholder="请输入项目IP地址" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="端口" prop="appport">
              <el-input v-model="form.appport" placeholder="请输入项目端口" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="项目类型" prop="apptypeid">
              <el-select v-model="form.apptypeid" placeholder="请选择项目类型" clearable>
                <el-option
                  v-for="apptype in appTypeOptions"
                  :key="apptype.id"
                  :label="apptype.apptypename"
                  :value="apptype.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="所属部门" prop="departmentId">
              <treeselect v-model="form.departmentId" :options="deptOptions" :show-count="true" placeholder="请选择所属部门" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="所属省份" prop="region">
              <el-input v-model="form.region" placeholder="请输入所属省份" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="所属城市" prop="city">
              <el-input v-model="form.city" placeholder="请输入所属城市" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="经度" prop="longitude">
              <el-input v-model="form.longitude" placeholder="请输入经度" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="纬度" prop="latitude">
              <el-input v-model="form.latitude" placeholder="请输入纬度" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="3D模型" prop="modelIp">
              <el-input v-model="form.modelIp" placeholder="请输入3D模型地址" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="2D模型" prop="model2dIp">
              <el-input v-model="form.model2dIp" placeholder="请输入2D模型地址" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="项目简介" prop="appIntroduction">
              <el-input v-model="form.appIntroduction" type="textarea" placeholder="请输入项目简介等内容" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {listAppmanager, getAppmanager, delAppmanager, addAppmanager, updateAppmanager, appTypeSelect, initAppmanager, fixAppmanager, restoredAppmanager, deptTreeSelect} from "@/api/system/appmanager";
import Treeselect from "_@riophae_vue-treeselect@0.4.0@@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import cache from "@/plugins/cache";
import store from "@/store";


export default {
  name: "Appmanager",
  dicts: ['sys_init_yes_no','sys_notice_status'],
  components: { Treeselect },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      showLeft: true,
      spanColLeft: 4,
      spanColRight: 20,
      // 总条数
      total: 0,
      // 项目信息表格数据
      appmanagerList: [],
      // 弹出层标题
      title: "",
      // 部门树选项
      deptOptions: undefined,
      // 项目类型树选项
      appTypeOptions: undefined,
      // 是否显示弹出层
      open: false,
      // 部门名称
      deptName: undefined,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        appName: null,
        ipaddr: null,
        appport: null,
        apptypeid: null,
        appimg: null,
        appexplain: null,
        appstate: null,
        state: null,
        region: null,
        city: null,
        longitude: null,
        latitude: null,
        appIntroduction: null,
        customer: null,
        runStatus: null,
        departmentId: null,
        deptId: undefined
      },
      // 表单参数
      form: {},
      defaultProps: {
        children: "children",
        label: "label"
      },
      currentProjectName: '',
      // 列信息
      columns: [
        { key: 0, label: `项目ID`, visible: true },
        { key: 1, label: `数据库名称`, visible: true },
        { key: 2, label: `项目节点IP地址`, visible: true },
        { key: 3, label: `项目节点端口`, visible: true },
        { key: 4, label: `项目节点用户名`, visible: true },
        { key: 5, label: `项目名称`, visible: true },
        { key: 6, label: `所属部门`, visible: true },
        { key: 7, label: `项目类型`, visible: false },
        { key: 8, label: `是否初始化`, visible: true },
        { key: 9, label: `是否关闭`, visible: true },
        { key: 10, label: `所属省份`, visible: true },
        { key: 11, label: `所属城市`, visible: true },
        { key: 12, label: `经度`, visible: true },
        { key: 13, label: `纬度`, visible: true },
      ],
      // 表单校验
      rules: {
        appexplain: [
          { required: true, message: "项目名称不能为空", trigger: "blur" }
        ],
        appName: [
          { required: true, message: "数据库名称不能为空", trigger: "blur" },
          {
            pattern: /^[A-Za-z0-9]+$/,
            message: "请输入正确的端口",
            trigger: "blur"
          }
        ],
        apptypeid: [
          { required: true, message: "项目类型不能为空", trigger: "blur" }
        ],
        ipaddr: [
          { required: true, message: "项目IP地址不能为空", trigger: "blur" }
        ],
        appport: [
          { required: true, message: "项目端口不能为空", trigger: "blur" },
          {
            pattern: /^([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{4}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,
            message: "请输入正确的端口",
            trigger: "blur"
          }
        ],
        departmentId: [
          { required: true, message: "所属部门不能为空", trigger: "blur" }
        ],
        region: [
          { required: true, message: "省份不能为空", trigger: "blur" }
        ],
        city: [
          { required: true, message: "城市不能为空", trigger: "blur" }
        ],
        longitude: [
          { required: true, message: "经度不能为空", trigger: "blur" }
        ],
        latitude: [
          { required: true, message: "维度不能为空", trigger: "blur" }
        ]
      }
    };
  },
  watch: {
    // 根据名称筛选部门树
    deptName(val) {
      this.$refs.tree.filter(val);
    }
  },
  created() {
    this.currentProjectName = cache.local.get("currentProjectName");
    console.log(this.currentProjectName)
    this.getList();
    this.getDeptTree();
    this.getAppTypeSelect();
  },
  methods: {
    /** 查询项目信息列表 */
    getList() {
      this.loading = true;
      listAppmanager(this.queryParams).then(response => {
        this.appmanagerList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    handleShowLeft(){
      const show = this.showLeft;
      if(show){
        this.showLeft = false;
        this.spanColLeft = 0;
        this.spanColRight = 24;
      }else{
        this.showLeft = true;
        this.spanColLeft = 4;
        this.spanColRight = 20;
      }
    },
    /** 查询部门下拉树结构 */
    getDeptTree() {
      deptTreeSelect().then(response => {
        this.deptOptions = response.data;
      });
    },
    /** 查询项目类型 */
    getAppTypeSelect() {
      appTypeSelect().then(response => {
        this.appTypeOptions = response.data;
      });
    },
    // 筛选节点
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    // 节点单击事件
    handleNodeClick(data) {
      this.queryParams.departmentId = data.id;
      this.handleQuery();
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        appid: null,
        appName: null,
        ipaddr: null,
        appport: null,
        apptypeid: null,
        appimg: null,
        appexplain: null,
        appstate: null,
        state: null,
        region: null,
        city: null,
        longitude: null,
        latitude: null,
        appIntroduction: null,
        customer: null,
        runStatus: null,
        departmentId: null,
        createTime: null,
        modelIp: null,
        model2dIp: null,
        model2dDataid: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      console.log(this.currentProjectName)
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.queryParams.departmentId = null;
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.appid)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加项目信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const appid = row.appid || this.ids
      getAppmanager(appid).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改项目信息";
      });
    },
    /** 初始化项目操作 */
    handleInit(row) {
      const appid = row.appid || this.ids;
      this.$modal.confirm('是否确认初始化编号为"' + appid + '"的项目信息？').then(function() {
        return initAppmanager(appid);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("初始化成功");
      }).catch(() => {});
    },
    /** */
    restoredProject(row) {
      const appids = row.appid || this.ids;
      this.$modal.confirm('是否确认恢复编号为"' + appids + '"的项目信息？').then(function() {
        return restoredAppmanager(appids);
      }).then(() => {
        this.currentProjectName = cache.local.get("currentProjectName");
        this.getList();
        this.$modal.msgSuccess("恢复成功");
      }).catch(() => {});
    },
    /** 进入某个项目操作 */
    handleFixProject(total,row) {
      const appid = row.appid || this.ids;
      const appName = row.appName;
      const appExplain = row.appexplain;
      const dbName = appid + appName;
      if(total > 1){
        this.$modal.confirm('是否确认进入编号为"' + appid + '"的项目"' + appExplain + '"？').then(function() {
          //成功后是否要隐藏”项目列表“菜单？
          return fixAppmanager(appid);
        }).then(() => {
          cache.local.set("currentProject",dbName);
          cache.local.set("currentProjectName",appExplain);
          const tempDbName = cache.local.get("currentProject");
          const tempDbNameCN = cache.local.get("currentProjectName");
          console.log(tempDbName + ":" + tempDbNameCN);
          store.commit('SET_PROJECTNAME', tempDbNameCN);//改变界面导航栏中间的项目信息

          //隐藏隐藏”项目列表“菜单

          //重新加载菜单，隐藏”项目列表“菜单成功后，重新加载菜单
          this.currentProjectName = cache.local.get("currentProjectName");
          this.getList();//重新获取项目列表
          //提示
          this.$modal.msgSuccess("进入编号为'" + appid + "'的项目'" + appExplain + "'");
          console.log("成功进入项目：" + dbName);

        }).catch(() => {
        });
      }else{
        this.$cache.local.set("currentProject",dbName);
        this.$cache.local.set("currentProjectName",appExplain);
        const tempDbName = this.$cache.local.get("currentProject");
        const tempDbNameCN = this.$cache.local.get("currentProjectName");
        console.log(tempDbName + ":" + tempDbNameCN);
        store.commit('SET_PROJECTNAME', tempDbNameCN);//改变界面导航栏中间的项目信息


        //隐藏”项目列表“菜单
        let result = fixAppmanager(appid);//解析result来判断
        //console.log("进入项目：" + result);
      }
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.appid != null) {
            updateAppmanager(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addAppmanager(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const appids = row.appid || this.ids;
      this.$modal.confirm('是否确认删除项目信息编号为"' + appids + '"的数据项？').then(function() {
        return delAppmanager(appids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/appmanager/export', {
        ...this.queryParams
      }, `appmanager_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
